
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[PerferencesCheck]
    @UserId INT ,
    @ItemsCount INT OUTPUT
AS 
    BEGIN
        SELECT  @ItemsCount = COUNT(*)
        FROM    Perferences
        WHERE   Name IS NOT NULL
                AND Value IS NOT NULL
                AND UserId = @UserId
    END
GO
